package com.handsome.命令模式;

/**
 * @author niechun
 * @date 2023/3/15 20:00
 */
public class TelevisionOffCommand implements Command {

    private TelevisionReceiver televisionReceiver;

    public TelevisionOffCommand(TelevisionReceiver televisionReceiver) {
        this.televisionReceiver = televisionReceiver;
    }

    @Override
    public void execute() {
        televisionReceiver.off();
    }

    @Override
    public void undo() {
        televisionReceiver.on();
    }
}
